//
//  shopDetailsTableViewCell.m
//  lmq
//
//  Created by 千翼网络科技 on 2017/4/5.
//  Copyright © 2017年 yuanxin. All rights reserved.
//

#import "shopDetailsTableViewCell.h"
#import "configddd.h"
#import <Masonry/Masonry.h>

@implementation shopDetailsTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:@"identifier"]) {
        
        [self initView];
    }
    return self;
}

- (void) initView{
    
    self.backgroundColor = getColor(@"ffffff");
    
    //name
    _nameLable = [[UILabel alloc]init];
    _nameLable.textColor = getColor(@"1e1d23");
    _nameLable.font = get4sFont(12);
//    _nameLable.backgroundColor = [UIColor redColor];
    _nameLable.textAlignment = NSTextAlignmentLeft;
    _nameLable.numberOfLines = 0;
    [self addSubview:_nameLable];
    [_nameLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(20));
        make.left.mas_equalTo(self).with.offset(screenScale(20));
        make.right.mas_equalTo(self).with.offset(screenScale(-20));
        
    }];
    
    //price
    _priceLable = [[UILabel alloc]init];
    _priceLable.textColor = getColor(@"c4171b");
    _priceLable.font = get4sFont(14);
    _priceLable.textAlignment = NSTextAlignmentLeft;
    _priceLable.numberOfLines = 0;
    [self addSubview:_priceLable];
    [_priceLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(100));
        make.left.mas_equalTo(self).with.offset(screenScale(20));
        
        make.height.mas_equalTo(screenScale(30));
    }];
    
    //beforePrice
    _beforePriceLable = [[UILabel alloc]init];
    _beforePriceLable.textColor = getColor(@"b8b8b9");
    _beforePriceLable.font = get4sFont(10);
    _beforePriceLable.textAlignment = NSTextAlignmentLeft;
    [self addSubview:_beforePriceLable];
    [_beforePriceLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).with.offset(screenScale(150));
        make.left.mas_equalTo(self).with.offset(screenScale(20));
        
        make.height.mas_equalTo(screenScale(22));
    }];
    
    //thread
    _threadView = [[UIView alloc]initWithFrame:CGRectMake(0, screenScale(180), scrWidth(), screenScale(16))];
    _threadView.backgroundColor = getColor(@"f1f4f4");
    [self addSubview:_threadView];
    
    //logo
    _logoImg = [[UIImageView alloc]init];
    [self addSubview:_logoImg];
    [_logoImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_threadView).with.offset(screenScale(36));
        make.left.mas_equalTo(_threadView).with.offset(screenScale(20));
        make.width.mas_equalTo(screenScale(120));
        make.height.mas_equalTo(screenScale(185));
    }];
    
    //shop_content
//    _textLab = [[UILabel alloc]init];
//    _textLab.text = @"11111";
//    _textLab.textColor = getColor(@"020203");
//    _textLab.font = get4sFont(11);
//    _textLab.textAlignment = NSTextAlignmentLeft;
//    _textLab.numberOfLines = 0;
//    [self addSubview:_textLab];
//    [_textLab mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.mas_equalTo(_logoImg.mas_top);
//        make.left.mas_equalTo(_logoImg.mas_right).with.offset(screenScale(20));
//        make.right.mas_equalTo(self).with.offset(screenScale(-20));
//        make.bottom.mas_equalTo(_logoImg.mas_bottom).with.offset(screenScale(-20));
//    }];
    
    _text = [[UITextView alloc]init];
    _text.editable = NO;
    _text.font = get4sFont(11);
    _text.textColor = getColor(@"020203");
    [self addSubview:_text];
    [_text mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_logoImg.mas_top);
        make.left.mas_equalTo(_logoImg.mas_right).with.offset(screenScale(20));
        make.right.mas_equalTo(self).with.offset(screenScale(-20));
        make.bottom.mas_equalTo(_logoImg.mas_bottom).with.offset(screenScale(-20));
    }];
}

@end
